package com.ddd.demo.test;

import java.util.Arrays;

public class T1 {


    public static void main(String[] args) {

        int[] arr = new int[]{2, 3, 1, 4, 5};
        test(arr);

    }

    private static void test(int[] arr) {
        int length = arr.length;

        int mid = length / 2;

        int[] left = Arrays.copyOfRange(arr, 0 ,mid);
        int[] right = Arrays.copyOfRange(arr, mid, length);

        System.out.println("left = " + Arrays.toString(left));
        System.out.println("right = " + Arrays.toString(right));

    }

}
